package com.example.agent_springai.entity.query;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.ai.tool.annotation.ToolParam;

import java.time.LocalDate;
import java.util.List;

@Data
public class TemperQuery {

    @ToolParam(required = false,description = "发电机编号，字段名为generatorNo。例如:5 表示5号发电机")
    private String generatorNo;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @ToolParam(required = false, description = "查询开始日期，默认为2025-01-01。格式为 yyyy-MM-dd，例如 \"2025-01-01\"")
    private LocalDate startDate = LocalDate.of(2025, 1, 1);

    @JsonFormat(pattern = "yyyy-MM-dd")
    @ToolParam(required = false, description = "查询结束日期，默认为今天。格式为 yyyy-MM-dd，例如 \"2025-12-31\"。")
    private LocalDate endDate = LocalDate.now();


    @ToolParam(required = false, description = "查询的温度最高值，单位为°C; 如果用户询问超温，则为50.0°C; 用户没有这个要求为无。")
    private Double temperMax = null;

    @ToolParam(required = false, description = "查询的温度最低值，单位为°C; 用户没有这个要求为无。")
    private Double temperMin = null;


    @ToolParam(required = false, description = "排序方式")
    private List<Sort> sorts;

    /**
     * 排序内部类
     */
    @Data
    public static class Sort {
        @ToolParam(required = false, description = "排序字段，如recordTime（记录日期）")
        private String field;
        @ToolParam(required = false, description = "是否是升序：true/false")
        private Boolean asc;
    }
}